﻿<?xml version="1.0" encoding="utf-8"?>
<UserControl
	x:Class="ICSharpCode.AvalonEdit.AddIn.Snippets.SnippetOptionPanel" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:core="http://icsharpcode.net/sharpdevelop/core" xmlns:AvalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition
				Height="Auto" />
			<RowDefinition
				Height="2*" MinHeight="120" />
			<RowDefinition
				Height="1*" MinHeight="80" />
		</Grid.RowDefinitions>
		<Grid
			Grid.Column="0"
			Grid.Row="0">
			<Grid.RowDefinitions>
				<RowDefinition
					Height="Auto" />
				<RowDefinition
					Height="Auto" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition
					Width="Auto" />
				<ColumnDefinition
					Width="*" />
			</Grid.ColumnDefinitions>
			<Label
				Content="{core:StringParse ${res:Dialog.Options.CodeTemplate.ExtensionsLabel}:}"
				Grid.Column="0"
				Grid.Row="0"
				Target="{Binding ElementName=extensionComboBox}" />
			<ComboBox
				Name="extensionComboBox"
				DisplayMemberPath="Extensions"
				Grid.Column="1"
				Grid.Row="0"
				Margin="0,0,4,0"
				Height="23" />
			<StackPanel
				Grid.Column="0"
				Grid.ColumnSpan="2"
				Grid.Row="1"
				Orientation="Horizontal">
				<Button
					Content="{core:Localize Dialog.Options.CodeTemplate.AddGroupLabel}"
					Margin="0,8,0,8"
					Style="{x:Static core:GlobalStyles.ButtonStyle}"
					Click="AddGroupButton_Click" />
				<Button
					Content="{core:Localize Dialog.Options.CodeTemplate.RemoveGroupLabel}"
					Margin="8,8,0,8"
					Style="{x:Static core:GlobalStyles.ButtonStyle}"
					Click="RemoveGroupButton_Click" />
				<Button
					Content="{core:Localize Dialog.Options.CodeTemplate.EditGroupLabel}"
					Margin="8,8,0,8"
					Style="{x:Static core:GlobalStyles.ButtonStyle}"
					Click="EditGroupButton_Click" />
			</StackPanel>
		</Grid>
		<!--<DockPanel
			Grid.Row="1"
			Grid.Column="0">
			<StackPanel
				DockPanel.Dock="Right"
				VerticalAlignment="Center">
				<Button
					Content="{core:Localize Global.AddButtonText}"
					Height="23"
					Margin="4,4,4,4"
					Padding="9,1,9,1"
					Click="AddSnippetButton_Click" />
				<Button
					Content="{core:Localize Global.EditButtonText}"
					Height="23"
					Margin="4,4,4,4"
					Padding="9,1,9,1"
					Click="EditSnippetButton_Click" />
				<Button
					Content="{core:Localize Global.RemoveButtonText}"
					Height="23"
					Margin="4,4,4,4"
					Padding="9,1,9,1"
					Click="RemoveSnippetButton_Click" />
			</StackPanel>-->
		<core:RestrictDesiredSize
			Grid.Row="1"
			Grid.Column="0">
			<DataGrid
				x:Name="dataGrid"
				SelectionMode="Single"
				CanUserAddRows="True"
				CanUserDeleteRows="True"
				SelectionUnit="FullRow"
				HeadersVisibility="Column"
				CanUserResizeRows="False"
				AutoGenerateColumns="False"
				ItemsSource="{Binding ElementName=extensionComboBox, Path=SelectedItem.Snippets}"
				SelectionChanged="DataGrid_SelectionChanged">
				<DataGrid.Columns>
					<DataGridTextColumn
						Header="{core:Localize Dialog.Options.CodeTemplate.Template}"
						Binding="{Binding Name}" />
					<DataGridTextColumn
						Header="{core:Localize Dialog.Options.CodeTemplate.Keyword}"
						Binding="{Binding Keyword}" />
					<DataGridTextColumn
						Header="{core:Localize Dialog.Options.CodeTemplate.Description}"
						Width="*"
						Binding="{Binding Description}" />
				</DataGrid.Columns>
			</DataGrid>
		</core:RestrictDesiredSize>
		<!--</DockPanel>-->
		<core:RestrictDesiredSize
			Grid.Column="0"
			Grid.Row="2">
			<AvalonEdit:TextEditor
				x:Name="snippetTextBox"
				FontFamily="Consolas, Courier New"
				TextChanged="SnippetTextBox_TextChanged"/>
		</core:RestrictDesiredSize>
	</Grid>
</UserControl>